Function port()
uses the method described in
C<U+00F3>rdoba et al. (2018). In summary, it consists on generating a random
matrix Q
and performing row-wise orthogonalization such that if i
and j
are not adjacent in ug
, then the rows corresponding to such indices are
orthogonalized, without violating previous orthogonalizations and without
introducing unwanted independences. The resulting matrix after the process
has finished is the cross product of Q
.
Function port_chol()
uses the method described in C<U+00F3>rdoba et
al. (2019), combining uniform sampling with partial orthogonalization as
follows. If the graph provided is not chordal, then a chordal cover is found
using gRbase::triangulate()
. Then uniform sampling for the upper Choleksy
factor corresponding to such chordal cover is performed with mh_u()
.
Finally, it uses partial orthogonalization as port()
to add the missing
zeros (corresponding to fill-in edges in the chordal cover). The behaviour of
this function is the same as port()
.
We also provide an implementation of the most commonly used in the
literature diagdom()
. By contrast, this method produces a random matrix M
with zeros corresponding to missing edges in ug
, and then enforces a
dominant diagonal to ensure positive definiteness. Matrices produced by
diagdom
usually are better conditioned than those by port
; however, they
typically suffer from small off-diagonal entries, which can compromise model
validation in Gaussian graphical models. This is avoided by port
.